Passed
Push — master ( b23f10...be41ab )
by Marcus
01:43
created

setup.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 1
rs 10
1
/**
2
 * Connect to the database and setup it with some default data.
3
 */
4
"use strict";
5
const Model = require("./model");
6
7
const dsn =  process.env.DBWEBB_DSN || "mongodb://localhost:27017/math";
8
9
const fs = require("fs");
10
const path = require("path");
11
const docs = JSON.parse(fs.readFileSync(
12
    path.resolve(__dirname, "setup.json"),
13
    "utf8"
14
));
15
16
17
let model = new Model();
18
19
// Do it.
20
model.resetCollection(dsn, "formulas", docs)
21
    .catch(err => console.log(err));
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
22